<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>档案修改</title>
		<meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
	</head>
	<style>
		.selectrecord{
			background-image: url(../../images/record/2019-11-01_154437.png);
			height: 33px;
			width: 568px;
			text-align: left;
		}
		/*下拉按钮样式**/
        .down-panel{
            padding: 0;
            z-index: 100;
            overflow:visible;
        }
        .down-panel .layui-select-title{
            padding-right:30px;
            padding-left:10px;
            overflow:visible;
        }
        .down-panel dl{
            color: #000;
            top: 30px;
            font-size: 14px;
        }
        .down-panel .layui-select-title i{
            border-top-color:#fff;
        }
        .down-panel:hover{
            opacity:1 !important;
            filter:alpha(opacity=100) !important;
            color:#fff
        }
        .layui-anim-upbit{
            top: 100% !important;
            z-index: 999999 !important;
        }
        .layui-anim-upbit dd {
            text-align: left;
        }
        .over-hover{
            overflow: visible; z-index: 9999;
        }
        .layui-select-title{
            background-color: #008FBF;
        }
        .layui-table-box{
            overflow: visible;!important;
        }
        .layui-table-body{
            overflow: visible;!important;
        }
	</style>
	<body>
		<form method="post" id="form1" enctype="multipart/form-data">
		<div class="layui-tab layui-tab-card">
		    <div class="layui-tab-item layui-show" align="center">
		    <font size="4"><b>归档案件修改</b></font>
					<hr>
					<div class="layui-inline">
			            <font color="red">* </font><font size="3">案件</font><br>
			            <div class="layui-input-inline">
			              <input type="button" id="casechoice" name="casechoice" onclick="selectCase()" class="selectrecord">
			            </div>
			        </div>
			        <br>
			        <br><input type="hidden" id="mpid" name="empid">
			        <input type="hidden" id="aseName" name="caseName">
			        <input type="hidden" id="recordid1" name="recordId">
			        <br>
			        <div class="layui-inline">
			        	<font color="red">* </font><font size="3">相关文件: </font>
			        	<input type="text" id="text" style="width: 100px;height: 30px;" readonly="readonly"/>
			            <br>
			            <br>
			            <div class="layui-input-inline">
			            	<font size="4">上传文件：</font>
			            	<input type="file" name="file" />
			            </div>
			        </div>
			        <br>
			        <br>
			        <br>
			        <br>
		    		<br>
		    		<br>
		    		<input type="button" value="上传" onclick="tijiaowenjian()" class="layui-btn layui-btn-normal">
		   
		   
		</div>
		</form>
	</body>
<script src="../../layuiadmin/layui/layui.js"></script>
<script src="../../layuiadmin/jquery/jquery.min.js" type="text/javascript"></script>
<script src="../../layuiadmin/js/system/jquery.cookie.js"></script>
<script>
	$(function(){
		layui.use('form', function(){
        var form = layui.form; 
    	 });
    	var parentData=(parent.parentData);
    	$("#casechoice").val(parentData.caseId.caseId);
    	$("#text").val(parentData.archivefile);
    	$("#recordid1").val(parentData.recordId);
//  	var casechoice = $("#casechoice").val();
//  	var filename = $("#filename").val();
//  	var recordId = $("#recordid1").val();
	});
	function selectCase(){
				layui.use('layer', function(){
				  var layer = layui.layer;
				  layer.open({
                        type: 2,
                        anim: 4,
                        shadeClose:true,
                        title: ['案件选择', 'font-size:18px;'],
                        offset: '10px',
                        area: ['900px', '700px'],
                        content:'record_caseselect.html'
                 });
				});  
				
			}
	function tijiaowenjian(){
			  	 	var userid =  $.cookie("redisId");
			  	 	$("#mpid").val(userid);
			  	 	$("#aseName").val($("#casechoice").val())
			  	 	var formdata=new FormData(document.getElementById("form1"));
					  $.ajax({
			            url:"http://localhost:8080/record/updatetransmitted",
			            type:"post",
			            data:formdata,
			            processData:false,
			            contentType:false,
			            success:function(data){
			                console.log("over..");
			                if(data=="ok"){
			                    alert("修改成功")
			                    var index=layer.open();
			                    layer.close(index);
			                    parent.location.reload();
			                }else{
			                    alert("修改失败!")
			                }
			            },
			            error:function(e){
			                alert("上传文件超出范围，请选择小于1mb的文件！");
			            }
       				 });
				}
</script>
</html>
